package com.ecp.crm.bean;

import java.util.Date;

import com.ecp.commons.annotation.VariantType;
import com.ecp.commons.serialization.GenericBean;
import com.ecp.commons.serialization.SerializableObject;
import com.ecp.commons.serialization.Variant;

public class Admin extends GenericBean implements SerializableObject {

	@Override
	public void defineVariantSet() {
		entity = "admin";
		map.put("id", new Variant().setType(VariantType.INTEGER).setPk(true));
		map.put("loginId", new Variant().setType(VariantType.STRING));
		map.put("password", new Variant(VariantType.STRING, false, 64, "passwordhash", false, true, true));
		map.put("realName", new Variant().setType(VariantType.STRING));
		map.put("random", new Variant().setType(VariantType.STRING));
		map.put("mId", new Variant().setType(VariantType.INTEGER));
		map.put("isUsable", new Variant().setType(VariantType.INTEGER));
		map.put("loginCount", new Variant().setType(VariantType.INTEGER));
		map.put("createDate", new Variant().setType(VariantType.DATETIME));
		map.put("lastLoginTime", new Variant().setType(VariantType.DATETIME));
		map.put("description", new Variant().setType(VariantType.STRING));
	}
	//ss

	@Override
	public void resetValues() {
		this.set("id", 0);
		this.set("loginId", "");
		this.set("password", "");
		this.set("realName", "");
		this.set("random", "");
		this.set("mId", 0);
		this.set("isUsable", 1);
		this.set("loginCount", 0L);
		this.set("createDate", (Date) null);
		this.set("lastLoginTime", (Date) null);
		this.set("description", "");
	}

	public int getId() {
		return this.getInt("id");
	}

	public void setId(int id) {
		this.set("id", id);
	}

	public String getLoginId() {
		return this.getString("loginId");
	}

	public void setLoginId(String loginId) {
		this.set("loginId", loginId);
	}

	public String getPassword() {
		return this.getString("password");
	}

	public void setPassword(String password) {
		this.set("password", password);
	}

	public String getRealName() {
		return this.getString("realName");
	}

	public void setRealName(String realName) {
		this.set("realName", realName);
	}

	public String getRandom() {
		return this.getString("random");
	}

	public void setRandom(String random) {
		this.set("random", random);
	}

	public int getMId() {
		return this.getInt("mId");
	}

	public void setmId(int mId) {
		this.set("mId", mId);
	}

	public int getIsUsable() {
		return this.getInt("isUsable");
	}

	public void setIsUsable(int isUsable) {
		this.set("isUsable", isUsable);
	}

	public long getLoginCount() {
		return this.getLong("loginCount");
	}

	public void setLoginCount(long loginCount) {
		this.set("loginCount", loginCount);
	}

	public Date getCreateDate() {
		return this.getDate("createDate");
	}

	public void setCreateDate(Date createDate) {
		this.set("createDate", createDate);
	}

	public Date getLastLoginTime() {
		return this.getDate("lastLoginTime");
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.set("lastLoginTime", lastLoginTime);
	}

	public String getDescription() {
		return this.getString("description");
	}
	
	public void setDescription(String description) {
		this.set("description", description);
	}
}
